import java.awt.Point;
import java.awt.Rectangle;


public class LaserWall {
	
	private int frameCounter;
	private int framesPerChange;
	boolean isOn;
	
	
	Rectangle bb;
	
	Point loc; //tiles
	
	int framerate;
	
	public LaserWall( Point loc, int secondsPerState, int framerate ){
		this.loc = loc;
		this.framesPerChange = secondsPerState* framerate;
		this.frameCounter = 0;
		bb = new Rectangle( loc.x * 40, loc.y * 40, 40, 40);
		isOn = true;
		
		this.framerate = framerate;
	}
	
	public void update(){
		frameCounter = (++frameCounter)%framesPerChange;
		if(frameCounter==0){
			isOn=!isOn;
		}
	}
	public void reset(){
		isOn = true;
		this.frameCounter = 0;
	}
	
	public Rectangle getRect(){
		return bb;
	}
	
}
